home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sea_intro.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  189 lines

  1. # Jones 3D Cog Script
  2. #
  3. # sea_intro.cog
  4. #
  5. #    [DS & HB]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ==============================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     user0
  15.  
  16.     keyframe    in_standup=0in_getup_bunkbed.key    local # 35x
  17.  
  18.     sound        music0=mus_sea_intro.wav            local
  19.  
  20.     thing        player                                local
  21.     thing        brigindy                            local # create on the fly
  22.  
  23.     thing        fader0                                nolink # gen_fadeplat thing
  24.     thing        fader1                                nolink # gen_fadeplat thing
  25.     thing        fader2                                nolink # gen_fadeplat thing
  26.  
  27.     thing        cam_1                                nolink
  28.     thing        cam_2                                nolink
  29.     thing        brig_cam_1                            nolink
  30.     
  31.     thing        ct_1                                nolink
  32.     thing        ct_2                                nolink
  33.     thing        brig_ct_1                            nolink
  34.     thing        brig_ct_repeat                        local # create on the fly
  35.  
  36.     thing        brig_mk_1                            nolink
  37.     thing        brig_mk_2                            nolink
  38.     thing        brig_mk_3                            nolink
  39.  
  40.     template    indy_tpl=indy_actor                    local
  41.     template    ghost_tpl=ghost                        local
  42.     
  43.     int            playCollType                        local
  44.     int            in_track1                            local
  45.  
  46.     int            bSeen=0                                local
  47.  
  48. end
  49.  
  50. # ==============================================================================
  51.  
  52. code
  53.  
  54. startup:
  55.  
  56.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  57.  
  58.     Sleep(0.001); # Let engine get set up
  59.  
  60.     # Start on black...
  61.     SetCameraFocus(2, cam_1);
  62.     SetCameraSecondaryFocus(2, ct_1);
  63.     SetCameraPosInterp(2, 0);
  64.     SetCameraLookInterp(2, 0);
  65.     SetCurrentCamera(2);
  66.  
  67.     return;
  68.  
  69. # ..............................................................................
  70.  
  71. user0: # RT: Indicates that autosave/restore has completed...
  72.  
  73.     if (bSeen) return; # RT
  74.     bSeen = 1;
  75.  
  76. #   if you're going to switch the camera to start your level cutscene,
  77. #    do it first before anything else!
  78.     SetCameraFocus(2, cam_1);
  79.     SetCameraSecondaryFocus(2, ct_1);
  80.     SetCameraPosInterp(2, 0);
  81.     SetCameraLookInterp(2, 0);
  82.     SetCurrentCamera(2);
  83.  
  84. #   cutscene camera is set up and set as current,
  85. #    now sleep for 0.01 to let the engine generate a frame
  86.  
  87.     sleep(0.001);
  88.  
  89. #    then you can do the rest of the stuff you need to start your cutscene.
  90. #   IMPORTANT! -- don't do a StartCutscene() until after the new camera is set
  91. #    and has had a chance
  92. #   to render a frame! 
  93.  
  94.     player = GetLocalPlayerThing();
  95.     SetActorFlags(player, 0x200000);
  96.     SetThingFlags(player, 0x80000);
  97.     playCollType = GetCollideType(player);
  98.     SetCollideType(player, 0);
  99.     RestoreExtCam();
  100.     Sleep(0.001);
  101.     StartCutscene(2);
  102.     SetThingFlags(fader0, 0x80000);
  103.     PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
  104.  
  105.     # Hal's intro...
  106.     SetCameraFOV(70, 0, 0.0);
  107.     ClearThingFlags(fader0, 0x80000);
  108.     SetThingAlpha(fader0, 1.0);
  109.     ClearThingFlags(fader1, 0x80000);
  110.     SetThingAlpha(fader1, 0.0); # should make it invisible
  111.     SetThingFlags(fader1, 0x10); # invisible (hack)
  112.     SetCameraInterpSpeed(2, 10.0);
  113.     SetCameraLookInterp(2, 1);
  114.     SetCameraPosInterp(2, 1);
  115.     Sleep(0.01);
  116.     ThingFadeAnim(fader0, 1.0, 0.0, 0.6, 0);
  117.     Sleep(0.2);
  118.     SetCameraFocus(2, cam_2);
  119.     SetCameraSecondaryFocus(2, ct_2);
  120.     SetCameraFOV(20, 1, 10.0);
  121.     Sleep(10.0);
  122.     DestroyThing(fader0);
  123.     ClearThingFlags(fader1, 0x10);
  124.     ThingFadeAnim(fader1, 0.0, 1.0, 1.5, 0);
  125.     Sleep(1.5);
  126.     DestroyThing(fader1);
  127.  
  128.     # Make an actor and target...
  129.     brigindy = CreateThing(indy_tpl, brig_mk_3);
  130.     brig_ct_repeat = CreateThing(ghost_tpl, brig_ct_1);
  131.  
  132.     # Cut to Indy in the brig...
  133.     SetCameraPosInterp(2, 0);
  134.     SetCameraLookInterp(2, 0);
  135.     SetCameraFocus(2, brig_cam_1);
  136.     SetCameraSecondaryFocus(2, brig_ct_repeat);
  137.     SetCurrentCamera(2);
  138.     SetCameraFOV(61, 0, 0.0); # was 50
  139.     ClearThingFlags(brigindy, 0x80000);
  140.  
  141.  
  142.     # Indy needs to have no weapons or whip.
  143.     #    CopyPlayerHolsters(player, brigindy);
  144.  
  145.     in_track1 = PlayKey(brigindy, in_standup, 4, 0x12, 0);
  146.     PauseKey(brigindy, in_track1); # hold
  147.     ClearThingFlags(fader2, 0x80000);
  148.     SetThingAlpha(fader2, 1.0);
  149.     ThingFadeAnim(fader2, 1.0, 0.0, 1.5, 0);
  150.     Sleep(1.5);
  151.     SetThingFlags(fader2, 0x80000);
  152.  
  153.     # Indy stands up...
  154.     ResumeKey(brigindy, in_track1);
  155.     SetCameraFOV(80, 1, 2.2);
  156.     Sleep(1.2);
  157.     AttachThingToThing(brig_ct_repeat, brigindy);
  158.     AISetMoveSpeed(brigindy, 0.8);
  159.     AISetLookThingEyeLevel(brigindy, brig_mk_1);
  160.     AISetMoveThing(brigindy, brig_mk_1, 1);
  161.     AISetLookThingEyeLevel(brigindy, brig_mk_2);
  162.     Sleep(0.5);
  163.  
  164.     # Clean up & restore control...
  165.     ResetCameraFOV(0, 0.0);
  166.     SetCameraInterpSpeed(2, 1);    # reset default
  167.     SetCameraLookInterp(2, 0);
  168.     SetCameraPosInterp(2, 0);
  169.     SetCameraPosition(1, GetThingPos(brig_cam_1)); # prep follow-cam
  170.     SetCurrentCamera(1);
  171.  
  172.     RestoreExtCam();
  173.     Sleep(0.001);
  174.  
  175.     ResetCameraFOV(0, 0.0);
  176.     TeleportThing(player, brigindy);
  177.     # SetThingFlags(brigindy, 0x80000);
  178.     DestroyThing(brigindy);
  179.     DestroyThing(brig_ct_repeat);
  180.     ClearThingFlags(player, 0x80000);
  181.     SetCollideType(player, playCollType);
  182.     EndCutscene();
  183.     ClearActorFlags(player, 0x200000);
  184.  
  185.     return;
  186.  
  187. end
  188.  
  189.